<style>
.user_add {
	float: left;
	overflow: hidden;
	width: 480px;
	 height:290px;
}
.user_add h1 {

	font-family: 微软雅黑;
	font-weight: 100;
	line-height: 35px;
	margin: 0 0 10px;
	padding: 0 0 5px;
}
.user_add table {
	background: none repeat scroll 0 0 #FFFFFF;
	border: 1px solid #E0DFDF;
	border-collapse: collapse;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
	float: left;
	height: auto;
	line-height: 20px;
	text-align: center;
	width: auto;
}
.user_add table tr td {
	border: 1px solid #E0DFDF;
	padding: 5px;
}
.user_add table strong {
	
	display: block;
	width: 120px;
}
.user_add table input[type="text"] {
	border: 1px solid #DBD9D9;
	height: 25px;
	line-height: 25px;
	width: 502px;
}
</style>

{{include file="./jquery_validator2.htm"}}
<div class="user_add message">
 <form id="order_review">
  <table style="width:480px; text-align:left">
    <caption>
    <h1 class="htitle">我要评价</h1>
    </caption>
     
    
    <tbody>
      <tr>
        <td colspan="2">
        <span class="text-success">这个方案在你的小店里</span>
        <input type="radio" value="3" name="score" {{if $review.score=='3'}} checked="checked"{{/if}}/>
         <span class="label label-success"> 好评 </span>  &nbsp;&nbsp;
          <input type="radio" value="2" name="score" {{if $review.score=='2'}} checked="checked"{{/if}}/>
         <span class="label label-warning"> 中评 </span> &nbsp;&nbsp;
          <input type="radio" value="1" name="score" {{if $review.score=='1'}} checked="checked"{{/if}}/>
         <span class="label label-danger"> 差评
 </span></td>
      </tr>
      <tr>
        <td><strong class="text-success">为了不使我行小区业务走弯路，请真实表达你对该产品的感受：</strong></td>
        <td><textarea style="width:249px; height: 142px;" name="content" class="msg_box content" onclick="if(this.value=='感受不能少于20字') this.value=''">{{if $review}}{{$review.content}}{{else}}感受不能少于20字{{/if}}</textarea></td>
      </tr>
      <tr>
        <input type="hidden" name="user_id" value="{{$session.user_id}}" class="user_id"/>
        <input type="hidden" name="user_name" value="{{$session.user_info.user_name}}" class="user_name"/>
        <input type="hidden" name="id" value="{{$id}}" class="id"/>
        <input type="hidden" name="id" value="{{$review.r_id}}" class="r_id"/>
        <td align="center" colspan="2" style="height:auto"><input type="button" onclick="orderReview()" class="green_btn" value="提交" /></td>
      </tr>
    </tbody>
  </table>
  </form>
</div>
<script>

function orderReview(){
	var score = $("input[name=score]:checked").val() || 0;
	
	var content = $("textarea[name=content]").val() ;
	content =  (content=='感受不能少于20字') ? '' :  content ;
	if(score && content && content.length>20)
	{
		Main.review('.message','3','{{$order_id}}')		;
	}
	else
	{
		alert("请选择推广效果\n感受不能少于20字");	
	}
	//
}

</script>